Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: automate wiremock version update #220

Merged
merged 2 commits into from
Oct 25, 2023

Conversation

olblak
Copy link
Contributor

@olblak olblak commented Oct 25, 2023

fix #171

This pullrequest introduces Updatecli to automate Wiremock version update.
Updatecli will monitor Wiremock releases and if something change, it will create a temporary branch, and a open a pull request targeting main with suggested change. If anything goes wrong, we can still refuse the PR or disable Updatecli later on

To work we need two things:

An Updatecli GitHub workflow
Updatecli is command line tool, the workflow can be triggered either manually with the workflow_dispatch event or via the cronjob every hour. Each time Updatecli is executed, it loads manifests that describe update pipeline.

An Updatecli manifest

The manifest describes

  1. Where the source information comes from, in this case the Wiremock latest GitHub release
  2. Validate conditions, in this case that a docker image exist for the retrieved version
  3. Update if necessary the targets. In this case we have a file named "_config.yml" with two information to update
  4. The configuration for the pullrequest (actions)
  5. The git repository to interact with (scms)

I executed the Updatecli command locally to see what would be changed

Console Output
 => updatecli diff --config updatecli/updatecli.d/


+++++++++++
+ PREPARE +
+++++++++++

Loading Pipeline "updatecli/updatecli.d/wiremock.yaml"

SCM repository retrieved: 1


++++++++++++++++++
+ AUTO DISCOVERY +
++++++++++++++++++



++++++++++++
+ PIPELINE +
++++++++++++



#########################################################
# DOCS: BUMP WIREMOCK VERSION USED IN THE DOCUMENTATION #
#########################################################


SOURCES
=======

wiremock
--------
Searching for version matching pattern "*"
✔ GitHub release version "3.2.0" found matching pattern "*" of kind "semver"


CHANGELOG:
----------

Release published on the 2023-09-27 14:49:16 +0000 UTC at the url https://github.com/wiremock/wiremock/releases/tag/3.2.0

<!-- Optional: add a release summary here -->
## 💥 Breaking changes

* Enable local response templating by default in standalone (#2386) @tomakehurst
* Add startup option to enable/disable extension scanning and set to disabled by default when running from Java (#2385) @tomakehurst

## 🚀 New features and improvements

* Exposing MappingsLoader as an extension point (#2334) @bharatnpti
* Include more info when webhook refusal logged (#2389) @Mahoney
* HTTP Server Factory as an extension point (#2391) @tomakehurst
* Print loaded extensions at startup (#2381) @tomakehurst

## 🐛 Bug fixes

* Fix json string schema rejecting numbers (#2390) @Mahoney
* Fix FileSource backed blobstore keys bug (#2392) @tomakehurst
* Fixed #2388 - empty getPath() returned from new FileStore implementation passed to transformers (#2396) @tomakehurst

## 📦 Dependency updates

* Bump io.netty:netty-all from 4.1.97.Final to 4.1.98.Final (#2394) @dependabot



CONDITIONS:
===========

docker
------
✔ docker image wiremock/wiremock:3.2.0 found


TARGETS
========

wiremock_version
----------------

**Dry Run enabled**

✔ - key "$.wiremock_version" already set to "3.2.0", from file "_config.yml"

wiremock_baseline
-----------------

**Dry Run enabled**

✔ - key "$.wiremock_baseline" already set to "3.x", from file "_config.yml"


ACTIONS
========


=============================

REPORTS:



✔ docs: bump wiremock version used in the documentation:
	Source:
		✔ [wiremock] Get latest Wiremock version
	Condition:
		✔ [docker] Check that a docker image is available for the latest version
	Target:
		✔ [wiremock_baseline] docs: update Wiremock version to 3.2.0
		✔ [wiremock_version] docs: update Wiremock version to 3.2.0


Run Summary
===========
Pipeline(s) run:
  * Changed:	0
  * Failed:	0
  * Skipped:	0
  * Succeeded:	1
  * Total:	1

References

  • TODO

Submitter checklist

  • The PR request is well described and justified, including the body and the references
  • The PR title represents the desired changelog entry
  • If the change against WireMock 2 functionality (incompatible with WireMock 3),
    it is submitted against the 2.x branch
  • The repository's code style is followed (see the contributing guide)

Details: Contributor Guide

@olblak olblak requested a review from oleg-nenashev as a code owner October 25, 2023 11:41
@oleg-nenashev oleg-nenashev added the chore Maintenance label Oct 25, 2023
Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a few wording corrections

.github/updatecli/updatecli.d/wiremock.yaml Outdated Show resolved Hide resolved
.github/updatecli/updatecli.d/wiremock.yaml Outdated Show resolved Hide resolved
.github/updatecli/updatecli.d/wiremock.yaml Outdated Show resolved Hide resolved
.github/updatecli/updatecli.d/wiremock.yaml Outdated Show resolved Hide resolved
.github/updatecli/updatecli.d/wiremock.yaml Outdated Show resolved Hide resolved
.github/updatecli/updatecli.d/wiremock.yaml Outdated Show resolved Hide resolved
.github/updatecli/updatecli.d/wiremock.yaml Outdated Show resolved Hide resolved
@olblak
Copy link
Contributor Author

olblak commented Oct 25, 2023

Thanks for the suggestion, ping me if anything goes wrong

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see! YOLO, let's see how the PRs go

@oleg-nenashev oleg-nenashev merged commit 72fc436 into wiremock:main Oct 25, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue on Download and Installation - Docker image references non-existent 3-digit tags
2 participants